function timeScript(){
    let date = '2012-12-6';
    let year = date.split('-')[0];
    let mouth = date.split('-')[1]-1;
    let day = date.split('-')[2];
    var together = new Date();
    together.setFullYear(year,mouth, day); 			//时间年月日
    together.setHours(0);						//小时	
    together.setMinutes(0);					//分钟
    together.setSeconds(0);					//秒前一位
    together.setMilliseconds(0);
    timeElapse(together);
}
//定时器任务 
function schedule(){
    timeScript();
    setInterval('timeScript()',1000);
}
function timeElapse(date){
    var current = Date();
    var seconds = (Date.parse(current) - Date.parse(date)) / 1000;
    var days = Math.floor(seconds / (3600 * 24));
    seconds = seconds % (3600 * 24);
    var hours = Math.floor(seconds / 3600);
    if (hours < 10) {
        hours = "0" + hours;
    }
    seconds = seconds % 3600;
    var minutes = Math.floor(seconds / 60);
    if (minutes < 10) {
        minutes = "0" + minutes;
    }
    seconds = seconds % 60;
    if (seconds < 10) {
        seconds = "0" + seconds;
    }
    var result = "第 <span class=\"digit\">" + days + "</span> 天 <span class=\"digit\">" + hours + "</span> 小时 <span class=\"digit\">" + minutes + "</span> 分钟 <span class=\"digit\">" + seconds + "</span> 秒";
    $("#clock").html(result);
}